<div id="headerContent1">
        <?php $count = Yii::app()->getModule('user')->getInboxView(); 
                $user = Users::model()->findByPk(Yii::app()->user->id);
        ?>
        <div id="loginPanel">
            <?php if($count != 0): ?>
                <a class="profileButton" href="">
                    <?php echo "<span>".$user->name."</span>"; ?>
                        <span class="notiCount"><?php echo "$count" ?></span>
                </a>
            <?php else: ?>
                <a class="profileButton" href="">
                    <?php echo "<span style='padding-left: 0px;'>".$user->name."</span>"; ?>
                </a>
            <?php endif; ?>
                <ul>
                    <li><a href="<?php echo Yii::app()->createUrl('/user/inbox'); ?>"><?php $n = Yii::app()->getModule('user')->getInboxView();
                        if ($n == 0 ) {
                            echo "Tin nhắn";
                        }else{
                            echo "Tin nhắn <span style='padding-left: 1px;' id='loadinbox'>($n)</span>";
                        }
                     ?></a></li>
                    <li><a href="<?php echo Yii::app()->createUrl('user/userprofiles/view',array('id'=>$user->userProfile->id)); ?>">Th&#244;ng tin c&#225; nh&#226;n</a></li>
                    <li><a href="<?php echo Yii::app()->createUrl('/user/register/changepass'); ?>">Đổi mật khẩu</a></li>
                    <li><a href="index.php?r=user/login/logout">Tho&#225;t</a></li>
                </ul>
        </div>
        
        <div class="clear">
        </div>
    </div>
<script>
 $(document).ready(function() {
   var refreshId = setInterval(function() {
      $("#headerContent1").load("<?php echo Yii::app()->createUrl('/user/inbox/load'); ?>");
      // $(".loadinbox").load("<?php echo Yii::app()->createUrl('/user/inbox/load'); ?>");
   }, 10000);
   $.ajaxSetup({ cache: false });
});
</script>